package com.xframework.security.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.xframework.annotation.MappingColumn;
import com.xframework.annotation.MappingTable;
import com.xframework.model.BaseModel;

/**
 * 资源表.
 *
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@MappingTable(tableName = "SECURITY_RESOURCE")
public class Resource extends BaseModel {
	/**
	 * id.
	 */
	@MappingColumn(columnName = "RESOURCE_ID", columnPk = true, columnLength = 32)
	private String resourceId;
	/**
	 * 上级id.
	 */
	@MappingColumn(columnName = "RESOURCE_PARENT_ID")
	private String resourceParentId;
	/**
	 * 资源名称.
	 */
	@MappingColumn(columnName = "RESOURCE_NAME")
	private String resourceName;
	/**
	 * 资源地址.
	 */
	@MappingColumn(columnName = "RESOURCE_URL")
	private String resourceUrl;
	/**
	 * 资源顺序.
	 */
	@MappingColumn(columnName = "RESOURCE_SEQ")
	private Integer resourceSeq;
	/**
	 * 资源备注.
	 */
	@MappingColumn(columnName = "RESOURCE_ICON")
	private String resourceIcon;

	/**
	 * 资源类型 1 菜单 2 按钮 3 url.
	 */
	@MappingColumn(columnName = "RESOURCE_TYPE_ID")
	private Integer resourceTypeId;

	@MappingTable(tableName = "SECURITY_RESOURCE_TYPE")
	private ResourceType resourceType;

	@MappingColumn(columnName = "RESOURCE_REMARK")
	private String resourceRemark;

	/**
	 * 资源属性 1 有效 2 无效.
	 */
	@MappingColumn(columnName = "RESOURCE_STATE")
	private Integer resourceState;
	/**
	 * 创建时间.
	 */
	@MappingColumn(columnName = "RESOURCE_CREATE_TIME")
	private String resourceCreateTime;
	/**
	 * 修改时间.
	 */
	@MappingColumn(columnName = "RESOURCE_MODIFY_TIME")
	private String resourceModifyTime;
	/**
	 * 系统表ID.
	 */
	@MappingColumn(columnName = "APPLICATION_ID")
	private String applicationId;
	/**
	 * 系统表.
	 */
	@MappingTable(tableName = "SECURITY_APPLICATION")
	private Application application;

	/**
	 * 资源列表.
	 */
	@MappingTable(tableName = "SECURITY_RESOURCE", modelClass = Resource.class)
	private List<Resource> resourceList = new ArrayList<Resource>();

	public Resource() {
	}

	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public String getResourceParentId() {
		return resourceParentId;
	}

	public void setResourceParentId(String resourceParentId) {
		this.resourceParentId = resourceParentId;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public String getResourceUrl() {
		return resourceUrl;
	}

	public void setResourceUrl(String resourceUrl) {
		this.resourceUrl = resourceUrl;
	}

	public Integer getResourceSeq() {
		return resourceSeq;
	}

	public void setResourceSeq(Integer resourceSeq) {
		this.resourceSeq = resourceSeq;
	}

	public String getResourceIcon() {
		return resourceIcon;
	}

	public void setResourceIcon(String resourceIcon) {
		this.resourceIcon = resourceIcon;
	}

	public Integer getResourceTypeId() {
		return resourceTypeId;
	}

	public void setResourceTypeId(Integer resourceTypeId) {
		this.resourceTypeId = resourceTypeId;
	}

	public ResourceType getResourceType() {
		return resourceType;
	}

	public void setResourceType(ResourceType resourceType) {
		this.resourceType = resourceType;
	}

	public String getResourceRemark() {
		return resourceRemark;
	}

	public void setResourceRemark(String resourceRemark) {
		this.resourceRemark = resourceRemark;
	}

	public Integer getResourceState() {
		return resourceState;
	}

	public void setResourceState(Integer resourceState) {
		this.resourceState = resourceState;
	}

	public String getResourceCreateTime() {
		return resourceCreateTime;
	}

	public void setResourceCreateTime(String resourceCreateTime) {
		this.resourceCreateTime = resourceCreateTime;
	}

	public String getResourceModifyTime() {
		return resourceModifyTime;
	}

	public void setResourceModifyTime(String resourceModifyTime) {
		this.resourceModifyTime = resourceModifyTime;
	}

	public String getApplicationId() {
		return applicationId;
	}

	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}

	public Application getApplication() {
		return application;
	}

	public void setApplication(Application application) {
		this.application = application;
	}

	public List<Resource> getResourceList() {
		return resourceList;
	}

	public void setResourceList(List<Resource> resourceList) {
		this.resourceList = resourceList;
	}
}
